CREATE TABLE [dbo].[DU_KHACH]
(
[SO_BOOKING] [char] (15) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[HO_TEN] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[NGAY_SINH] [date] NULL,
[DIA_CHI] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[GIOI_TINH] [char] (3) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[TRANG_THAI_PHONG_DON] [char] (5) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LOAI_KHACH] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DO_TUOI] [char] (10) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DU_KHACH] ADD CONSTRAINT [CK__DU_KHACH__DO_TUO__32E0915F] CHECK (([DO_TUOI]='TRE NHO' OR [DO_TUOI]='NGUOI LON' OR [DO_TUOI]='TRE EM' OR [DO_TUOI]='EM BE'))
GO
ALTER TABLE [dbo].[DU_KHACH] ADD CONSTRAINT [CK__DU_KHACH__GIOI_T__300424B4] CHECK (([GIOI_TINH]='NU' OR [GIOI_TINH]='NAM'))
GO
ALTER TABLE [dbo].[DU_KHACH] ADD CONSTRAINT [CK__DU_KHACH__LOAI_K__31EC6D26] CHECK (([LOAI_KHACH]='VIET NAM' OR [LOAI_KHACH]='NUOC NGOAI' OR [LOAI_KHACH]='VIET KIEU'))
GO
ALTER TABLE [dbo].[DU_KHACH] ADD CONSTRAINT [CK__DU_KHACH__TRANG___30F848ED] CHECK (([TRANG_THAI_PHONG_DON]='KHONG' OR [TRANG_THAI_PHONG_DON]='CO'))
GO
CREATE NONCLUSTERED INDEX [IX_DUKHACH] ON [dbo].[DU_KHACH] ([SO_BOOKING]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DU_KHACH] ADD CONSTRAINT [FK_DK_KHBOOKING] FOREIGN KEY ([SO_BOOKING]) REFERENCES [dbo].[KHACH_HANG_BOOKING] ([SO_BOOKING]) ON DELETE CASCADE
GO
